﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Micronet.OpenWeb.Utils;

namespace Micronet.OpenWeb.OpenWeb.Admin.Views.Shared.OpenPersonality
{
    public partial class FiveElementsEdit : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {

            

            if ("ID".OwQsIsExist())
            {
                FiveElementDv.DefaultMode = DetailsViewMode.Edit;
            }
            else
            {
                FiveElementDv.DefaultMode = DetailsViewMode.Insert;

            }

            FiveElementOds.Inserted += new ObjectDataSourceStatusEventHandler(FiveElementOds_Inserted);
            FiveElementOds.Deleted += new ObjectDataSourceStatusEventHandler(FiveElementOds_Deleted);
            FiveElementOds.Updated += new ObjectDataSourceStatusEventHandler(FiveElementOds_Updated);
        }

        void FiveElementOds_Updated(object sender, ObjectDataSourceStatusEventArgs e)
        {
            Response.Redirect("FiveElementsAdmin.aspx");
        }

        void FiveElementOds_Deleted(object sender, ObjectDataSourceStatusEventArgs e)
        {
            Response.Redirect("FiveElementsAdmin.aspx");

        }

        void FiveElementOds_Inserted(object sender, ObjectDataSourceStatusEventArgs e)
        {
            Response.Redirect("FiveElementsAdmin.aspx");

        }
    }
}